<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>angularJS-17课 ng-show、ng-if的使用</title>
    <script src="../js/angular.js"></script>
    <script type="text/javascript" src='../js/jquery.min.js'></script>
    <style type="text/css">
        .container > div{ line-height: 60px; }
    </style>
</head>
<body ng-app='app' ng-controller='myctrl'>
    <div>
        <label><input type="checkbox" name="" ng-model='status'>我已同意该协议</label><br>
        <button ng-disabled="!status">登录</button><br><br>
        <div class="container">
            <button ng-init='toggle' ng-click='toggle=!toggle'>查看该协议</button><br><br>
            <textarea name="" cols="30" rows="10" ng-if='toggle' >该协议是瞎编的</textarea>
        </div>

    </div>
</body>
    <script>
        var app = angular.module('app',[]);
        app.controller('myctrl',['$scope',function(){
          
        }]);
    </script>
</html>